﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace FatZombieAttack
{
    public class Player
    {
        private Vector2 PlayerPosition;
        private Texture2D PlayerImage;
        private int HealthPoints;
        private int Points;
        SpriteFont Font,Font2;
        string PositionString, HealthString,PointsString;
        

        public Player() { }
        public void Initialize()
        {
            HealthPoints = 100;
            Points = 1;
            PlayerPosition = new Vector2(1280 / 2, 750 / 2);
        }
        public virtual void LoadContent(ContentManager Content)
        {
            PlayerImage = Content.Load<Texture2D>("Sprites/Spelare");
            Font = Content.Load<SpriteFont>("Font/SpriteFont1");
            Font2 = Content.Load<SpriteFont>("Font/SpriteFont2");
            PointsString = Points.ToString();
            HealthString = HealthPoints.ToString();
        }
        public virtual void Update(GameTime gameTime)
        {
            Points = Points - 1;
            PositionString = PlayerPosition.ToString();
            HealthString = HealthPoints.ToString();
            PointsString = Points.ToString();
           
        }
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(Font2, "Points: ", new Vector2(0, 0), Color.White);
            spriteBatch.DrawString(Font2, PointsString, new Vector2(150, 0), Color.White);
            spriteBatch.Draw(PlayerImage, PlayerPosition, Color.White);
            spriteBatch.DrawString(Font, HealthString, new Vector2(PlayerPosition.X +12,PlayerPosition.Y -25), Color.White);
        }
        public float getplayerPositionx() { return PlayerPosition.X; }
        public float getmidplayerPositionx() { return PlayerPosition.X + PlayerImage.Width / 2; }
        public Vector2 getmidplayerPosition() { return new Vector2(PlayerPosition.X + PlayerImage.Width / 2, PlayerPosition.Y + PlayerImage.Height / 2); }
        public float getplayerPositiony() { return PlayerPosition.Y; }
        public float getmidplayerPositiony() { return PlayerPosition.Y + PlayerImage.Height / 2; }
        public void setplayerPositionx(float x) { PlayerPosition.X = x; }
        public void setplayerPositiony(float y) { PlayerPosition.Y = y; }
        public int getplayerPoints() { return Points; }
        public void setplayerPoints(int p) { Points = p; }
        public int getplayerHealthPoints() { return HealthPoints; }
        public void setplayerHealthPoints(int hp) { HealthPoints = hp; }

    }
}
